#pragma once
#include"RBTree.h"
namespace ns_self {
	template<class K, class V>
	class set {
		//仿函数，传入红黑树，用作泛型的比较
		struct SetKeyOfVal {
			const K& operator()(const K& key) {
				return key;
			}
		};
	public:

		typedef typename RBTree<K, K, SetKeyOfVal>::iterator iterator;  //正向迭代器
		typedef typename RBTree<K, K, SetKeyOfVal>::reverse_iterator reverse_iterator; //反向迭代器

		iterator begin() {
			return _t.begin();
		}

		iterator end()
		{
			return _t.end();
		}

		reverse_iterator rbegin() {
			return _t.rbegin();
		}

		reverse_iterator rend()
		{
			return _t.rend();
		}


		pair<iterator, bool> insert(const K& k) {
			return _t.Insert(k);
		}

		iterator find(const K& key)
		{
			return _t.Find(key);
		}


	private:
		RBTree<K, K, SetKeyOfVal> _t;
	};
}